@import '../../style/default.scss';
@import '../../style/mixin.scss';

.ad-form {
  display: block;
  width: 100%;
  position: relative;

  .ad-form-wrapper {
    display: flex;
    flex-wrap: wrap;
    align-content: flex-start;
  }
}

.ad-form-item {
  transition: margin 50ms ease-in-out;

  .ad-form-item-wrapper {
    width: 100%;
    height: 100%;
    display: flex;

    &.ad-direction-column {
      flex-direction: column;

      .ad-form-content {
        width: 100%;
      }

      .ad-form-item-label {
        max-width: 100%;
      }
    }

    .ad-form-item-label {
      flex-shrink: 0;
      max-width: 65%;
      font-size: 14px;
      line-height: 22px;
      padding: 5px 0;
      min-height: 32px;
      display: flex;
      align-items: center;
      color: rgba(0, 0, 0, 0.85);
      @include ad-text-warp;

      &.ad-start {
        text-align: left;
        justify-content: flex-start;
      }

      &.ad-end {
        text-align: right;
        justify-content: flex-end;
      }

      .ad-label-box {
        &::before {
          content: '*';
          display: inline-block;
          font-size: 12px;
          width: 12px;
          height: 22px;
          line-height: 26px;
          margin-left: -12px;
          color: transparent;
          text-align: center;
          vertical-align: bottom;
        }

        &.ad-required::before {
          color: $color-error;
        }
      }
    }

    .ad-form-content {
      flex: 1 0 0;
      width: 0;
      position: relative;

      mat-error.mat-error {
        background: #ffffff;
        border: 1px solid #bfbfbf;
        border-radius: 2px;
        padding: 4px 6px;
        position: absolute;
        left: 5px;
        top: 25px;
        font-size: 12px;
        z-index: 999;
        line-height: 1;
        filter: drop-shadow(2px 2px 2px rgba(0, 0, 0, 0.15));

        &:before {
          content: '';
          position: absolute;
          top: -14px;
          width: 0;
          height: 0;
          left: 10px;
          border-style: solid;
          border-width: 7px;
          border-color: transparent transparent #bfbfbf;
        }

        &:after {
          content: '';
          position: absolute;
          top: -13px;
          width: 0;
          height: 0;
          left: 10px;
          border-style: solid;
          border-width: 7px;
          border-color: transparent transparent #fff;
        }
      }
    }
  }
}

.ad-form-value {
  width: 100%;
  font-size: 14px;
  line-height: 22px;
  min-height: 32px;
  display: flex;
  align-items: center;
  padding: 5px 0;
  color: rgba(0, 0, 0, 0.65);

  &.ad-content-warp {
    @include ad-text-warp;

    div {
      @include ad-text-warp;
    }
  }

  &.ad-content-ellipsis {
    @include ad-text-hidden;

    div {
      @include ad-text-hidden;
    }
  }
}
